package forthwork.model;

/**
 * @author ：chenzikang
 * @date ： 2020/3/17
 */

public class Student {

    private String name;

    private int age;

    private String sex;

    public Student(){
        this.name=name;
        this.age=age;
        this.sex=sex;
    }

    // 语文成绩
    private double iChineseScore;

    //英语成绩
    private double iEnglishScore;

    //数学成绩
    private double iMathScore;

   // 各个属性的getter,setter方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public double getiChineseScore() {
        return iChineseScore;
    }

    public void setiChineseScore(double iChineseScore) {
        this.iChineseScore = iChineseScore;
    }

    public double getiEnglishScore() {
        return iEnglishScore;
    }

    public void setiEnglishScore(double iEnglishScore) {
        this.iEnglishScore = iEnglishScore;
    }

    public double getiMathScore() {
        return iMathScore;
    }

    public void setiMathScore(double iMathScore) {
        this.iMathScore = iMathScore;
    }

    //输入姓名，年龄，性别
    public void outInfo(){
        System.out.println(name+":"+age+":"+sex);
    }

    //返回成绩的总和
    public double sum(){
        return getiChineseScore()+getiEnglishScore()+getiMathScore();
    }

    //返回平均成绩
    public double average(){
        return (getiChineseScore()+getiEnglishScore()+getiMathScore())/3;
    }

    //输入成绩
    public void printScore(){
        System.out.println("语文成绩为:"+getiChineseScore());
        System.out.println("数学成绩为:"+getiMathScore());
        System.out.println("英语成绩为:"+getiEnglishScore());
        System.out.println("总成绩为："+sum());
        System.out.println("平均成绩为"+average());
    }
}
